<!-- Copyright (c) 2019 Legytma Soluções Inteligentes (https://legytma.com.br). -->
<!-- -->
<!--  Licensed under the Apache License, Version 2.0 (the "License"); -->
<!--  you may not use this file except in compliance with the License. -->
<!--  You may obtain a copy of the License at -->
<!-- -->
<!--       http://www.apache.org/licenses/LICENSE-2.0 -->
<!-- -->
<!-- Unless required by applicable law or agreed to in writing, software -->
<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -->
<!-- See the License for the specific language governing permissions and -->
<!-- limitations under the License. -->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, height=device-height, initial-scale=1, user-scalable=no">
    <meta name="generator" content="made with love by dartdoc 0.28.4">
    <meta name="description" content="schema_form API docs, for the Dart programming language.">
    <title>schema_form - Dart API docs</title>

    <link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:500,400i,400,300|Source+Sans+Pro:400,300,700"
          rel="stylesheet">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link rel="stylesheet" href="static-assets/github.css">
    <link rel="stylesheet" href="static-assets/styles.css">
    <link rel="icon" href="static-assets/favicon.png">

</head>

<body>

<div id="overlay-under-drawer"></div>

<header id="title">
    <button id="sidenav-left-toggle" type="button">&nbsp;</button>
    <ol class="breadcrumbs gt-separated dark hidden-xs">
        <li><a href="https://github.com/Legytma/schema_form">schema_form package</a></li>
    </ol>
    <div class="self-name">schema_form</div>
    <form class="search navbar-right" role="search">
        <input type="text" id="search-box" autocomplete="off" disabled
               class="form-control typeahead" placeholder="Loading search...">
    </form>
</header>

<main>

    <div id="dartdoc-sidebar-left"
         class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
        <header id="header-search-sidebar" class="hidden-l">
            <form class="search-sidebar" role="search">
                <input type="text" id="search-sidebar" autocomplete="off" disabled
                       class="form-control typeahead" placeholder="Loading search...">
            </form>
        </header>

        <ol class="breadcrumbs gt-separated dark hidden-l" id="sidebar-nav">
            <li><a href="https://github.com/Legytma/schema_form">schema_form package</a></li>
        </ol>

        <h5 class="hidden-xs"><span class="package-name">schema_form</span> <span
                class="package-kind">package</span></h5>
        <ol>
            <li class="section-title">Libraries</li>
            <li><a href="schema_form/schema_form-library.html">schema_form</a></li>
        </ol>
    </div>

    <div id="dartdoc-main-content" class="col-xs-12 col-sm-9 col-md-8 main-content">
        <section class="desc markdown">
            <p><a href="https://github.com/Legytma/schema_form/issues"><img
                    src="https://img.shields.io/github/issues/Legytma/schema_form"
                    alt="GitHub issues"></a>
                <a href="https://github.com/Legytma/schema_form/network"><img
                        src="https://img.shields.io/github/forks/Legytma/schema_form"
                        alt="GitHub forks"></a>
                <a href="https://github.com/Legytma/schema_form/stargazers"><img
                        src="https://img.shields.io/github/stars/Legytma/schema_form"
                        alt="GitHub stars"></a>
                <a href="https://github.com/Legytma/schema_form/blob/master/LICENSE"><img
                        src="https://img.shields.io/github/license/Legytma/schema_form"
                        alt="GitHub license"></a>
                <a href="https://pub.dev/packages/schema_form"><img
                        src="https://img.shields.io/pub/v/schema_form" alt="Pub"></a>
                <a href="https://github.com/tenhobi/effective_dart"><img
                        src="https://img.shields.io/badge/style-effective_dart-40c4ff.svg"
                        alt="style: effective dart"></a>
                <img src="https://img.shields.io/github/v/tag/Legytma/schema_form"
                     alt="GitHub tag (latest SemVer)">
                <img src="https://img.shields.io/github/languages/top/Legytma/schema_form"
                     alt="GitHub top language">
                <img src="https://img.shields.io/github/contributors/Legytma/schema_form"
                     alt="GitHub contributors">
                <img src="https://img.shields.io/github/last-commit/Legytma/schema_form"
                     alt="GitHub last commit"></p>
            <h1 id="convert-json-schema-to-form-for-flutter-apps">Convert Json Schema to Form for
                Flutter apps</h1>
            <ul>
                <li><a href="#what-is-it">What is it</a>
                    <ul>
                        <li><a href="#motivation">Motivation</a></li>
                        <li><a href="#how-this-work">How this work</a></li>
                    </ul>
                </li>
                <li><a href="#getting-started">Getting Started</a>
                    <ul>
                        <li><a href="#installation">Installation</a></li>
                        <li><a href="#usage">Usage</a></li>
                    </ul>
                </li>
                <li><a href="https://github.com/Legytma/schema_form/blob/master/CHANGELOG.md">CHANGELOG</a>
                </li>
                <li><a href="#next-steps">Next steps</a></li>
                <li><a href="https://github.com/Legytma/schema_form/blob/master/LICENSE">LICENSE</a>
                </li>
            </ul>
            <h2 id="what-is-it">What is it</h2>
            <p>Schema_form is a Flutter package based on two other packages that produces forms
                dynamically interpreting JSON objects:</p>
            <ul>
                <li><a href="https://pub.dev/packages/dynamic_widget">dynamic_widget</a> - Which
                    builds forms through JSON interpretation;
                </li>
                <li><a href="https://pub.dev/packages/json_schema">json_schema</a> - Identifying,
                    defining and validating the properties of the object being edited.
                </li>
            </ul>
            <h3 id="motivation">Motivation</h3>
            <p>A major difficulty for any application developer is to ensure that all users keep
                their applications up to date to ensure the same user experience and to reduce the
                time required to fix bugs.</p>
            <p>The most commonly used alternative to accelerate this process is <a
                    href="https://github.com/Microsoft/code-push">Code Push</a> which allows the
                application update without the need for a new deploy in the store. However in Code
                Push GitHub itself there is a <a
                        href="https://github.com/Microsoft/code-push/issues/624#issuecomment-532358395">Code
                    Push Support for Flutter</a> request with comment saying that support depends on
                implementing dynamic update support in Flutter, there is also a reference to <a
                        href="https://github.com/flutter/flutter/wiki/Roadmap#changes">Flutter
                    Roadmap</a> saying that support for This type of update is postponed according
                to the official comment <a
                        href="https://github.com/flutter/flutter/issues/14330#issuecomment-485565194">Code
                    Push / Hot Update / out of band updates</a>, which explains the reasons that led
                to the decision.</p>
            <p>One possible solution to this deadlock is to implement a JSON interpreter that
                enables screen redesign, which can be obtained using <a
                        href="https://github.com/dengyin2000/dynamic_widget">dynamic_widget</a>.
                However dynamic_widget does not support a dynamic form. This package was designed to
                meet this need.</p>
            <h3 id="how-this-work">How this work</h3>
            <h2 id="getting-started">Getting Started</h2>
            <ul>
                <li>For help over FormSchema usage, view the <a
                        href="https://github.com/Legytma/schema_form/tree/master/example">example</a>;
                </li>
                <li>For help over class documentation, view the <a
                        href="https://raw.githubusercontent.com/Legytma/schema_form/master/doc/api/index.html">documentation</a>;
                </li>
                <li>For help getting started with Flutter, view our online <a
                        href="https://flutter.io/">documentation</a>;
                </li>
                <li>For help on editing package code, view the <a
                        href="https://flutter.io/developing-packages/">documentation</a>.
                </li>
            </ul>
            <h3 id="installation">Installation</h3>
            <ul>
                <li>Add this to your package's pubspec.yaml file:</li>
            </ul>
            <pre class="language-yaml"><code class="language-yaml">dependencies:
  schema_form: "^1.0.0"
</code></pre>
            <ul>
                <li>You can install packages from the command line:
                    with Flutter:
                </li>
            </ul>
            <pre class="language-dart"><code>$ flutter packages get
</code></pre>
            <ul>
                <li>Import it Now in your Dart code, you can use:</li>
            </ul>
            <pre class="language-dart"><code class="language-dart"> import 'package:schema_form/schema_form.dart';
</code></pre>
            <h3 id="usage">Usage</h3>
            <pre class="language-dart"><code class="language-dart">  JsonSchemaBloc jsonSchemaBloc = JsonSchemaBloc(formContext: context); // Business Logic
  SchemaForm schemaForm = SchemaForm(jsonSchemaBloc: jsonSchemaBloc);   // Form Widget

  // Load files
  File layoutSchemaFile = new File("layoutSchema.json");  // JSON screen layout
  File dataSchemaFile = new File("dataSchema.json");      // Data Schema
  File dataValueFile = new File("dataValue.json");        // Object for editing

  // Get content of files
  String layoutSchemaContent = layoutSchemaFile.readAsStringSync();
  String dataSchemaContent = dataSchemaFile.readAsStringSync();
  String dataValueContent = dataValueFile.readAsStringSync();

  // Turn content into Map
  Map&lt;String, dynamic&gt; layoutSchemaMap = json.decode(layoutSchemaContent);
  Map&lt;String, dynamic&gt; dataSchemaMap = json.decode(dataSchemaContent);
  Map&lt;String, dynamic&gt; dataValueMap = json.decode(dataValueContent);

  // Turn Map into JsonSchema
  JsonSchema dataJsonSchema = JsonSchema.createSchema(dataSchemaMap);

  // Load to Business Logic
  jsonSchemaBloc.add(LoadLayoutSchemaEvent(layout: layoutSchemaMap));   // Layout
  jsonSchemaBloc.add(LoadDataSchemaEvent(dataSchema: dataJsonSchema));  // Json Schema
  jsonSchemaBloc.add(LoadDataEvent(data: dataValueMap));                // Object in edit

  print(jsonSchemaBloc.getFormData());  // Print the object being edited
</code></pre>
            <p align="center">
                <img width="300"
                     src="https://raw.githubusercontent.com/Legytma/schema_form/master/image1.png">
                <img width="300"
                     src="https://raw.githubusercontent.com/Legytma/schema_form/master/image2.png">
            </p>
            <h2 id="next-steps">Next steps</h2>
            <ul>
                <li><code>x</code> Make MVP</li>
                <li><code>x</code> Minimal documentation</li>
                <li><code> </code> Change event binding of click event</li>
            </ul>
        </section>

        <section class="summary">
            <h2>Libraries</h2>
            <dl>
                <dt id="schema_form">
                    <span class="name"><a
                            href="schema_form/schema_form-library.html">schema_form</a></span>
                </dt>
                <dd>

                </dd>
            </dl>
        </section>

    </div> <!-- /.main-content -->

    <div id="dartdoc-sidebar-right"
         class="col-xs-6 col-sm-6 col-md-2 sidebar sidebar-offcanvas-right">
    </div>

</main>

<footer>
  <span class="no-break">
    schema_form 1.0.0
  </span>


</footer>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="static-assets/typeahead.bundle.min.js"></script>
<script src="static-assets/highlight.pack.js"></script>
<script src="static-assets/URI.js"></script>
<script src="static-assets/script.js"></script>


</body>

</html>
